package com.cy.pj.sys.Dao;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
/***
 * 基于此Dao执行角色,菜单关系数据的操作
 * @author 15565
 *
 */
@Mapper
public interface SysRoleMenuDao {
	/** 基于菜单id删除角色菜单关系数据 */
	@Delete("delete from sys_role_menus where menu_id=#{id}")
	int deleteObjectByMenuId(Integer menuid);
	
	@Delete("delete from sys_role_menus where role_id=#{roleId}")
	int deleteObjectByRoleId(Integer roleId);
	
	int insertObjects(Integer roleId,Integer[] menuIds);
	
	List<Integer> findMenuIdsByRoleId(Integer roleId);
	/**
	 * 基于用户id查询用户对应的角色id
	 * @param id
	 * @return
	 */
	List<Integer> findMenuIdsByRoleIds(
			@Param("roleIds")List<Integer> roleIds);
}
